package com.aspose.cells;

public class ListColumn {
   private ListColumnCollection q;
   private String r;
   XmlColumnProperty a;
   int b;
   private String s;
   private int t;
   private String u;
   boolean c;
   String d;
   boolean e;
   byte[] f;
   byte[] g;
   int h;
   String i;
   String j;
   private String v;
   private String w;
   int[] k = new int[]{-1, -1, -1};
   Style l;
   Style m;
   int n = 0;
   int o = -1;
   long p;
   private int x = -1;

   FilterColumn a() {
      AutoFilter var1 = this.q.c().d;
      return var1 == null ? null : var1.e.a(this.c());
   }

   boolean b() {
      return this.q.c().B();
   }

   ListColumn(ListColumnCollection listColumns, String name, int index) {
      this.r = name;
      this.q = listColumns;
      this.o = index + 1;
   }

   ListColumn(ListColumnCollection listColumns) {
      this.q = listColumns;
   }

   void a(ListColumn var1, CopyOptions var2) {
      WorksheetCollection var3 = var1.q.c().g().d().c();
      WorksheetCollection var4 = this.q.c().g().d().c();
      boolean var5 = var3 == var4 || var2 == null || var2.a;
      this.r = var1.r;
      this.j = var1.j;
      this.i = var1.i;
      this.t = var1.t;
      if (var5) {
         this.d = var1.d;
         this.f = var1.f;
         this.e = var1.e;
         this.c = var1.c;
         this.u = var1.u;
      }

      this.w = var1.w;
      this.v = var1.v;
      this.o = var1.o;

      for(int var6 = 0; var6 < var1.k.length; ++var6) {
         this.k[var6] = var1.k[var6];
         if (var1.k[var6] != -1 && this.o() != var1.o()) {
            this.k[var6] = this.o().getDxfs().a(var1.o().getDxfs().get(var1.k[var6]));
         }
      }

      this.b(var1.n());
   }

   private WorksheetCollection o() {
      return this.q.c().g().d().c();
   }

   public String getName() {
      return this.r;
   }

   public void setName(String value) {
      this.r = value;
      ListObject var2 = this.q.c();
      if (var2.getShowHeaderRow()) {
         Cells var3 = var2.g().d().getCells();
         var3.a(var2.getStartRow(), this.d(), false).putValue(value);
      }

   }

   void a(String var1) {
      this.r = var1;
   }

   void b(String var1) {
      this.s = var1;
   }

   int c() {
      for(int var1 = 0; var1 < this.q.getCount(); ++var1) {
         if (this.q.get(var1) == this) {
            return var1;
         }
      }

      return 0;
   }

   int d() {
      return this.q.c().getStartColumn() + this.c();
   }

   public int getTotalsCalculation() {
      return this.t;
   }

   public void setTotalsCalculation(int value) {
      if (this.t != value) {
         ListObject var2 = this.q.c();
         this.t = value;
         if (var2.getShowTotals()) {
            Cells var3 = var2.g().d().getCells();
            Cell var4 = var3.a(var2.getEndRow(), this.d(), false);
            if (value == 0) {
               var4.putValue((Object)null);
            } else {
               var4.setFormula(this.c(value));
            }

         }
      }
   }

   void a(int var1) {
      this.t = var1;
   }

   void a(int var1, int var2) {
      if (this.d != null && !"".equals(this.d)) {
         Cells var3 = this.q.c().g().d().getCells();
         int var4 = this.q.c().getStartRow() + this.q.c().y();
         int var5 = this.d();
         Cell var6 = null;
         byte var7 = 8;
         if (var4 != var1) {
            var6 = var3.get(var4, var5);
         }

         if (var6 != null) {
            for(int var8 = 0; var8 < var2; ++var8) {
               var3.get(var1 + var8, var5).b(var6, var7);
            }
         }
      }

   }

   void b(int var1, int var2) {
      ListObject var3 = this.q.c();
      Worksheet var4 = var3.g().d();
      if (this.f != null) {
         zyo.c(var4, false, var1, var2, 0, 0, -1, -1, this.f);
      }

   }

   private String c(int var1) {
      StringBuilder var2 = new StringBuilder("=subtotal(");
      int var3 = this.d(var1);
      var2.append(var3);
      var2.append(",");
      Range var4 = this.q.c().getDataRange();
      String var5 = CellsHelper.cellIndexToName(var4.getFirstRow(), this.d());
      var2.append(var5);
      var2.append(":");
      var5 = CellsHelper.cellIndexToName(var4.getFirstRow() + var4.getRowCount() - 1, this.d());
      var2.append(var5);
      var2.append(")");
      return com.aspose.cells.b.a.zr.a(var2);
   }

   private int d(int var1) {
      switch(var1) {
      case 1:
         return 101;
      case 2:
         return 103;
      case 3:
         return 102;
      case 4:
         return 104;
      case 5:
         return 105;
      case 6:
         return 109;
      case 7:
         return 107;
      case 8:
         return 110;
      default:
         return 109;
      }
   }

   public Range getRange() {
      ListObject var1 = this.q.c();
      int var2 = var1.getStartColumn() + this.c();
      int var3 = var1.getStartRow();
      int var4 = var1.getEndRow();
      return new Range(var3, var2, var4 - var3 + 1, 1, this.q.c().g().d().getCells());
   }

   void a(String var1, boolean var2) {
      this.c = var2;
      this.u = var1;
   }

   boolean e() {
      return this.c;
   }

   String f() {
      return this.u;
   }

   void b(String var1, boolean var2) {
      this.e = var2;
      this.d = var1;
   }

   boolean g() {
      return this.e;
   }

   String h() {
      if (this.f != null) {
         ListObject var1 = this.q.c();
         Worksheet var2 = var1.g().d();
         return var2.c().b().a(-1, this.f, 0, 0, false);
      } else {
         return this.d;
      }
   }

   void i() {
      ListObject var1 = this.q.c();
      Worksheet var2 = var1.g().d();
      if (this.d != null) {
         this.f = var2.c().x().a(var2.getIndex(), this.d, var1.getStartRow() + 1, var1.getStartColumn(), this.e ? 1 : 0, 64, false, true, false);
      }

   }

   String j() {
      return this.v;
   }

   void c(String var1) {
      this.v = var1;
   }

   String k() {
      return this.w;
   }

   void d(String var1) {
      this.w = var1;
   }

   zbvr a(Style var1) {
      if (var1 != null) {
         zbvr var2 = new zbvr();
         var2.a(var1);
         if (var2.getCount() < 1) {
            var2 = null;
         }

         return var2;
      } else {
         return null;
      }
   }

   Style l() {
      if (this.l == null) {
         this.l = new Style(this.o());
         this.l.a((byte)0);
      }

      return this.l;
   }

   Style m() {
      if (this.m == null) {
         this.m = new Style(this.o());
         this.m.a((byte)0);
      }

      return this.m;
   }

   int n() {
      return this.x;
   }

   void b(int var1) {
      this.x = var1;
   }
}
